﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;

namespace OurMemory
{
    public partial class FormCreatePS : Form
    {
        private readonly ProblemSolvingServices service = new ProblemSolvingServices();
        
        public FormCreatePS()
        {
            InitializeComponent();
            
            panel1.BackgroundImageLayout = ImageLayout.Stretch;

            this.ClientSize = new Size(450, 400); // 设置客户区大小
        }

        private void FormCreatePS_Load(object sender, EventArgs e)
        {

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnok_Click(object sender, EventArgs e)
        {
            ProblemSolvingCreateModel model = new ProblemSolvingCreateModel()
            
            {
                Recorder = textRecorder.Text,
                Problem = textProblem.Text,
                Date = dTP.Value.Date,
                Urgency = textUrgency.Text,
            };
            service.Create(model);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
